package jpa.entitys.promis.construction;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the COST_BUDGET_ACTIVITY database table.
 * 
 */
@Embeddable
public class CostBudgetActivityPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(unique=true, nullable=false, length=30)
	private String company;

	@Column(unique=true, nullable=false, length=30)
	private String project;

	@Column(name="BUDGET_CODE", unique=true, nullable=false, length=30)
	private String budgetCode;

	@Column(name="BUILDING_PHASE", unique=true, nullable=false, length=30)
	private String buildingPhase;

	@Column(name="ACTIVITY_ID", unique=true, nullable=false, length=30)
	private String activityId;

    public CostBudgetActivityPK() {
    }
	public String getCompany() {
		return this.company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getProject() {
		return this.project;
	}
	public void setProject(String project) {
		this.project = project;
	}
	public String getBudgetCode() {
		return this.budgetCode;
	}
	public void setBudgetCode(String budgetCode) {
		this.budgetCode = budgetCode;
	}
	public String getBuildingPhase() {
		return this.buildingPhase;
	}
	public void setBuildingPhase(String buildingPhase) {
		this.buildingPhase = buildingPhase;
	}
	public String getActivityId() {
		return this.activityId;
	}
	public void setActivityId(String activityId) {
		this.activityId = activityId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CostBudgetActivityPK)) {
			return false;
		}
		CostBudgetActivityPK castOther = (CostBudgetActivityPK)other;
		return 
			this.company.equals(castOther.company)
			&& this.project.equals(castOther.project)
			&& this.budgetCode.equals(castOther.budgetCode)
			&& this.buildingPhase.equals(castOther.buildingPhase)
			&& this.activityId.equals(castOther.activityId);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.company.hashCode();
		hash = hash * prime + this.project.hashCode();
		hash = hash * prime + this.budgetCode.hashCode();
		hash = hash * prime + this.buildingPhase.hashCode();
		hash = hash * prime + this.activityId.hashCode();
		
		return hash;
    }
}